<?php

namespace app\admin\model\validate;

use think\Validate;

class Blessing extends Validate {
    protected $rule =   [
        'cate_id' => 'number|require',
        'cate_name' => 'require|max:24',
        'title' => 'require|max:20',
        'thumb_url' => 'require|max:255',
        'music_url' => 'require|max:255',
        'background' => 'require|max:255',
        'content' => 'require',
        'share_title' => 'max:30',
        'share_img_url' => 'max:255',
        'sort' => 'number',
        //'status' => 'number',
        //'type' => 'number',
    ];

    protected $message  =   [
        'cate_name.require'     => '祝福类别不能为空',
        'cate_name.max'     => '祝福类别最多不能超过24个字符',
        'title.require'     => '标题不能为空',
        'title.max'     => '标题不能超过20个字符',
        'thumb_url.require'     => '封面图片不能为空',
        'thumb_url.max'     => '封面图片不能超过255个字符',
        'background.max'     => '背景图片不能超过255个字符',
        'background.require'     => '背景图片不能为空',
        'content.require'     => '祝福内容不能为空',
        'share_title.max'     => '分享标题不能超过30个字符',
        'share_img_url.max'     => '分享封面不能超过255个字符',
        'sort.number'     => '排序不能必须是整数',
    ];

    protected $scene = [
        /*'add'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],
        'edit'  =>  ['name','theme','start_time', 'end_time', 'attention_tips', 'cover_image_url', 'sort', 'participate_num'],*/
    ];
}